<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: wlc
  Date: 2018/9/10
  Time: 15:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="PageFrame.jsp"%>

<title>用户文档</title>

<!-- Page Content -->
<div class="container" id="user-fileManager">
    <div class="file-manager-sidebar">
        <div class="file-manager-sidebar-title">文档管理</div>
        <div class="file-manager-sidebar-list">
            <ul role="tablist">
                <li id="file-write" onclick="window.location.href= '../fileManager/WriteFiles'"><span style="margin-right: 10px;">编写文档</span><i class="fa fa-pencil fw"></i></li>
                <li role="presentation" class="active">
                    <a href="#published-file" aria-controls="published-file" role="tab" data-toggle="tab">已发表</a>
                </li>
                <li role="presentation">
                    <a href="#draft-file" aria-controls="draft-file" role="tab" data-toggle="tab">草稿箱</a>
                </li>
                <li role="presentation">
                    <a href="#recycle-file" aria-controls="recycle-file" role="tab" data-toggle="tab"><span style="margin-right: 10px;">回收站</span><i class="fa fa-trash-o fw"></i></a>
                </li>
            </ul>
        </div>
    </div>
    <div class="file-manager-content tab-content">
        <div role="tabpanel" class="tab-pane active" id="published-file">
            <div class="file-manager-content-list">
                <c:forEach items="${userFiles}" var="userFile" varStatus="i">
                    <c:choose>
                        <c:when test="${userFile.getStatus()== '已发表'}"><div id="${userFile.getId()}" class="file-item-box">
                                <h4><a href="../fileManager/fileShow?fileId=${userFile.getId()}" target="_blank">${userFile.getTitle()}</a></h4>
                                <p class="file-content"><a href="../fileManager/fileShow?fileId=${userFile.getId()}" target="_blank"><c:out value="${userFile.getContent()}"></c:out></a></p>
                                <div class="file-info-box">
                                    <p><span class="file-info-box-date"><c:out value="${userFile.getDate()}"></c:out></span></p>
                                    <p><span class="file-info-box-type">类型：<c:out value="${userFile.getType()}"></c:out></span></p>
                                </div>
                                <div class="file-opt-box">
                                    <a class="btn-opt btn-edit">编辑</a>
                                    <button class="btn-opt btn-delete">删除</button>
                                </div>
                            </div></c:when>
                    </c:choose>
                </c:forEach>
            </div>
        </div>
        <div role="tabpanel" class="tab-pane" id="draft-file">
            <div class="file-manager-content-list">
                <c:forEach items="${userFiles}" var="userFile" varStatus="i">
                    <c:choose>
                        <c:when test="${userFile.getStatus()== '草稿箱'}"><div id="${userFile.getId()}" class="file-item-box">
                            <h4><a href="../fileManager/fileShow?fileId=${userFile.getId()}" target="_blank">${userFile.getTitle()}</a></h4>
                            <p class="file-content"><a href="../fileManager/fileShow?fileId=${userFile.getId()}" target="_blank"><c:out value="${userFile.getContent()}"></c:out></a></p>
                            <div class="file-info-box">
                                <p><span class="file-info-box-date"><c:out value="${userFile.getDate()}"></c:out></span></p>
                                <p><span class="file-info-box-type">类型：<c:out value="${userFile.getType()}"></c:out></span></p>
                            </div>
                            <div class="file-opt-box">
                                <a class="btn-opt btn-edit">编辑</a>
                                <button class="btn-opt btn-delete">删除</button>
                            </div>
                        </div></c:when>
                    </c:choose>
                </c:forEach>
            </div>
        </div>
        <div role="tabpanel" class="tab-pane" id="recycle-file">
            <div class="file-manager-content-list">
                <c:forEach items="${userFiles}" var="userFile" varStatus="i">
                    <c:choose>
                        <c:when test="${userFile.getStatus().contains('回收站')}"><div id="${userFile.getId()}" class="file-item-box">
                            <h4><a>${userFile.getTitle()}</a></h4>
                            <p class="file-content"><a><c:out value="${userFile.getContent()}"></c:out></a></p>
                            <div class="file-info-box">
                                <p><span class="file-info-box-date"><c:out value="${userFile.getDate()}"></c:out></span></p>
                                <p><span class="file-info-box-type">类型：<c:out value="${userFile.getType()}"></c:out></span></p>
                            </div>
                            <div class="file-opt-box">
                                <a class="btn-opt btn-reduction">还原</a>
                                <button class="btn-opt btn-delete">删除</button>
                            </div>
                        </div></c:when>
                    </c:choose>
                </c:forEach>
            </div>
        </div>
    </div>
</div>
<!-- /Page Content -->

<!-- js-->
<script src="../js/user-fileManager.js"></script>
<!-- /js-->